import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpMessage {
  id!: number;
  state!: boolean;
  type!: number;
  sign?: string;
  accessKeyId?: string;
  accessKeySecret?: string;
  txAppid?: string;
  txAppkey?: string;
  phone?: unknown;
  codeId?: string;
  yhxdtzId?: string;
  uniacid!: number;
}

export const ImsYzdKpMessageSchema = new EntitySchema({
  class: ImsYzdKpMessage,
  properties: {
    id: { primary: true, type: 'number' },
    state: { type: 'boolean', index: 'state' },
    type: { type: 'number', index: 'type' },
    sign: { type: 'string', length: 255, nullable: true },
    accessKeyId: { type: 'string', length: 255, nullable: true },
    accessKeySecret: { type: 'string', length: 255, nullable: true },
    txAppid: { type: 'string', length: 255, nullable: true },
    txAppkey: { type: 'string', length: 255, nullable: true },
    phone: { type: 'unknown', columnType: 'longtext', nullable: true },
    codeId: { type: 'string', length: 255, nullable: true },
    yhxdtzId: { type: 'string', length: 255, nullable: true },
    uniacid: { type: 'number', index: 'uniacid' },
  },
});
